;+
;PURPOSE
;	to make histogram plots
;
;Written by R. da Silva, UCSC, 4-21-10
;-
pro slug_plot, infile, outfile
if not keyword_set(infile) then begin
	print, '***infile not set***'
	def='$SLUG_DIR/output/SLUG_DEF.fits'
	print, 'Using default = '+def
	infile=def
endif
if not keyword_set(outfile) then begin
        print, '***outfile not set***'
        def='$SLUG_DIR/output/SLUG_DEF.ps'
        print, 'Using default = '+def
        outfile=def
endif



a=mrdfits(infile, 1, hdr)
ages=unique(a.age_gal)
!p.multi=[0, 2, 2]
!p.font=0
psopen, outfile, xs=8, ys=8, /inches
lsun=3.85d33

for i=0, n_elements(ages)-1 do begin
b=a[where(a.age_gal EQ ages[i])]

;plot_w_histo, alog10(b.lbol), alog10(b.lbol/(a.qh0/7.3d11)), $
plot_w_histo, alog10(b.lbol), alog10(b.fuv/(b.qh0/7.3d11)), $
	/xhist, /yhist, ps=3, /normxhist, /normyhist, $
	title=string(ages[i]/1d6, format='(f6.1)')+' Myr', $
	extra_yhist={charsize:.65}, xtitle= $
	textoidl('L_{bol} [erg/s]', font=0), $
	ytitle=textoidl('L_{FUV}/L_{H\alpha}', font=0), $
	 yr=[-15,0], xr=[33,42]

endfor
psclose


psopen, '$SLUG_DIR/output/bl.ps'
plot_w_histo, alog10(a.lbol), alog10(a.fuv/(a.qh0/7.3d11)), $
        /xhist, /yhist, ps=3, /normxhist, /normyhist, $
        extra_yhist={charsize:.5}, xtitle='L_{bol} [erg/s]', $
        ytitle=textoidl('L_{bol}/L_{H\alpha}', font=0) ;,xr=[37, 41], yr=[1, 4]
 

psclose


end
